﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ChangeTextHeight : MonoBehaviour
{
    public RectTransform r;
    public Text t;
    void Update()
    {
        r.localPosition = new Vector3(240, -(t.text.Length * 5 + 150) / 2);
        r.sizeDelta = new Vector3(425, t.text.Length * 6 + 100);
    }
}
